# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Maintainer: Sören Tempel <soeren+alpine@soeren-tempel.net>
pkgname=cyclone-stage0
pkgver=0.36.0
pkgrel=0
pkgdesc="Cyclone version used to initially bootstrap the Cyclone compiler"
url="https://justinethier.github.io/cyclone/"
# s390x, riscv64: ck on s390x does not have ck_pr_cas_8 (used by cyclone)
arch="all !s390x !riscv64"
license="MIT"
depends="!cyclone"
makedepends="ck-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/justinethier/cyclone-bootstrap/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/cyclone-bootstrap-$pkgver"

# Provide cyclone-bootstrap for community/cyclone.
# See the comment in community/cyclone for more information.
provides="cyclone-bootstrap=$pkgver"
provider_priority=1 # lowest

export PREFIX=/usr
export DATADIR=$PREFIX/lib/cyclone
export CFLAGS="$CFLAGS -Wno-int-conversion"

build() {
	make
}

check() {
	make test
}

package() {
	DESTDIR="$pkgdir" make install
}

sha512sums="
477534602baa4acbae0450e664617ad70302a79c552005741080c4e4d2993805ff1d25703bd2c43c82764a477a4b26fb4b88c8787a82e99fa5a6fc88d9f914f2  cyclone-stage0-0.36.0.tar.gz
"
